# $Id: PKGBUILD 108456 2014-03-27 14:47:54Z fyan $
# Maintainer: jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-mock
pkgname=(python-mock)
pkgver=4.0.2
pkgrel=1
pkgdesc='Mocking and Patching Library for Testing'
url='https://docs.python.org/3/library/unittest.mock.html'
depends=('python')
provides=("python3-mock")
conflicts=("python3-mock")
replaces=("python3-mock")
license=('BSD')
arch=('any')
source=("https://pypi.python.org/packages/source/m/mock/mock-$pkgver.tar.gz")
sha256sums=('dd33eb70232b6118298d516bbcecd26704689c386594f0f3c4f13867b2c56f72')
noextract=(mock-${pkgver}.tar.gz)

prepare() {
  [[ -d ${srcdir}/mock-${pkgver} ]] && rm -rf ${srcdir}/mock-${pkgver}
  tar -xzf ${srcdir}/mock-${pkgver}.tar.gz -C ${srcdir} || true
}

build() {
  cd "${srcdir}/mock-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/mock-${pkgver}"

  /usr/bin/python setup.py install --optimize=1 --root="$pkgdir"
  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
